package com.help.knowhelps.ui;


import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.help.knowhelps.R;

public class OtherHelpsCenterActivity extends Activity{
	private ImageView iv_icon;
	private TextView tv_name;
	private ListView lv_answer; 
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.other_help_center_activity);
		initComponent();
	}
	private void initComponent()
	{
		UiUtils.InitActionBar(this, "去帮忙", UiUtils.ACTIONBAR_BUTTON_DEFAULT, 
				UiUtils.ACTIONBAR_BUTTON_DISAPPEAR ,clicklistener);
		lv_answer= (ListView) findViewById(R.id.other_help_center_listView);
//		InitUser(iconDrawalbe,UserName) // do...      传递当前所查看用户的头像和名字
		
//		OtherHelpsCenterAdapter centeradapter = new OtherHelpsCenterAdapter(HelpOthersCenterActivity.this, list);  // do..传递帮助中心 数据..
//		lv_answer.setAdapter(centeradapter);
	}
	private void InitUser(Drawable iconDrawalbe,String UserName)
	{
		if(null == iconDrawalbe || null == UserName)  //异常处理
		{
			Toast.makeText(OtherHelpsCenterActivity.this, "读取用户信息失败,请重新尝试!", Toast.LENGTH_SHORT).show();
			finish();
		}
		iv_icon = (ImageView) findViewById(R.id.other_help_center_imageView_icon);
		tv_name = (TextView) findViewById(R.id.other_help_center_textView_Name);
		iv_icon.setImageDrawable(iconDrawalbe);
		tv_name.setText(UserName);
	}
	private OnClickListener clicklistener = new OnClickListener() {
		public void onClick(View v) {
			switch (v.getId()) {
			case R.id.actionbar_imageView_left:
				finish();
				break;
			default:
				break;
			}
		}
	};
}
